package autoproperties;

import controllers.Controller;
import annotation.PropertyAnnotation;
import annotation.PropertyAnnotation.ConfigName;


public class AutoProperties {

	private static AutoProperties AUTO_PROPERTIES;
	
	@PropertyAnnotation(getConfigName = ConfigName.garageProperty)
	public String garageProperty;
	
	@PropertyAnnotation(getConfigName=ConfigName.shiftProperty)
	public String shiftProperty;
	
	@PropertyAnnotation(getConfigName=ConfigName.deleteProperty)
	public String deleteProperty;
	
	@PropertyAnnotation(getConfigName = ConfigName.url)
	public String url;
	

	private AutoProperties() {
		
			Controller.setPropertyByAnnotation(this);
		
	}

	public static AutoProperties getInstance() {
		if (AUTO_PROPERTIES == null) {
			AUTO_PROPERTIES = new AutoProperties();
		}
		return AUTO_PROPERTIES;
	}


	public boolean getGarageManager() {
		return garageProperty.equals("true");		
	}

	public boolean getPermissionShiftTimeOrder() {
		return shiftProperty.equals("true");
	}

	public boolean getPermissionDeleteOrder() {
		return deleteProperty.equals("true");
	}

	public String getFilePath() {
		return url;
	}
	
	
	

}
